#pragma once

#include <QHeaderView>
#include <QRect>
#include <map>

#include "QbBondDefines.h"

class S_QBBOND_EXPORT BondHeaderView : public QHeaderView {
  Q_OBJECT
 public:
  BondHeaderView(Qt::Orientation orientation, QWidget* parent = nullptr);

 protected:
  void paintSection(QPainter* painter, const QRect& rect,
                    int logicalIndex) const override;
  void mouseMoveEvent(QMouseEvent* event) override;
  void mousePressEvent(QMouseEvent* event);
  void leaveEvent(QEvent* event);
  void dealTips(QMouseEvent* event, const QString& strTips);

 private:
  using MapBondHeadTips = std::map<int, std::pair<QRect, QString> >;
  mutable MapBondHeadTips m_tips;
};
